load(
    ":_calculate_rosidl_capitalization.bzl",
    "run_calculate_rosidl_capitalization_tests",
)

cc_library(
    name = "dload_shim_cc",
    srcs = ["tools/dload_shim.cc"],
    hdrs = ["tools/dload_shim.h"],
    # Don't create a separate shared library for just this one tiny source file
    # all by itself. Since this is only ever linked into binaries (not other
    # libraries), it's fine to always link it statically for simplicity.
    linkstatic = True,
    visibility = ["//visibility:public"],
    deps = ["@bazel_tools//tools/cpp/runfiles"],
)

py_library(
    name = "dload_shim_py",
    srcs = ["tools/dload_shim.py"],
    visibility = ["//visibility:public"],
    deps = ["@bazel_tools//tools/python/runfiles"],
)

run_calculate_rosidl_capitalization_tests()

py_library(
    name = "cmake_tools_py",
    srcs = glob(["resources/cmake_tools/**/*.py"]),
    imports = ["resources"],
    visibility = ["//visibility:private"],
)

py_library(
    name = "ros2bzl_py",
    srcs = glob(["resources/ros2bzl/**/*.py"]),
    imports = ["resources"],
    visibility = ["//visibility:private"],
    deps = [":cmake_tools_py"],
)

py_test(
    name = "plugin_xml_parsing_test",
    srcs = ["plugin_xml_parsing_test.py"],
    deps = [":ros2bzl_py"],
)
